import './public-path.js'
import Vue from 'vue'
import App from './App.vue'
import router from './router/index.js'

Vue.config.productionTip = false
let instance = null
function render (props) {
  const { container } = props
  /* eslint-disable */
  instance = new Vue({
    router,
    render: h => h(App)
  }).$mount(container ? container.querySelector('#app') : '#app')
}

// 独立运行时
if (!window.__POWERED_BY_QIANKUN__) {
  render()
}

export async function bootstrap () {
  // 启动微应用
}
export async function mount (props) {
  // 加载微应用
  render(props)
}
export async function unmount () {
  // 卸载微应用
  instance.$destroy()
  instance.$el.innerHTML = ''
  instance = null
}
export async function update () {
  // 更新微应用
}